package bb.lanxing.util.extender

import org.litepal.LitePal
import java.io.File
import java.io.FileInputStream
import java.io.InputStreamReader
import java.nio.charset.Charset

object KotlinExtender {
    @JvmOverloads
    fun <T> deleteAll(clazz: Class<T>, condition: String? = null, whereClause: String? = null) {
        LitePal.deleteAll(clazz, condition, whereClause)
    }

    fun readText(file: File, charset: Charset =  Charsets.UTF_8): String {
        val inputStream = InputStreamReader(FileInputStream(file), charset)
        val readText = inputStream.readText()
        return readText
    }
}